﻿var newsNum = 4;
var nn = 1;
function pp_portal_selectPicNew(o) 
{
    for (var i = 1; i <= newsNum; i++) 
    {
        //var newsId = "id_portal_imgNew" + i;
        if (o == i) 
        { // 被选中
            document.getElementById("id_portal_imgNew" + i).style.display = "block";
            document.getElementById("id_portal_navLink" + i).style.background = "red";
        } 
        else
        {
            document.getElementById("id_portal_imgNew" + i).style.display = "none";
            document.getElementById("id_portal_navLink" + i).style.background = "#333";
        }
    }
    nn = o;
}

                // 自动选择图片新闻 
function pp_portal_changePicNew()
{
    if (nn > newsNum) nn = 1;
    //alert(nn); 
    pp_portal_selectPicNew(nn);
    nn++;
}
function pp_portal_picNew_auto() 
{
    pp_portal_picNew_autoTask = setInterval('pp_portal_changePicNew()', 2000);
}
pp_portal_picNew_auto(); 